package mypazar.denemecartago;

import cartago.ArtifactId;
import cartago.CartagoException;
import cartago.CartagoNode;
import cartago.CartagoService;
import cartago.util.agent.CartagoBasicContext;

public class DenemeCartagoMain {

	private static final String PAZAR_ENV_NAME = "pazar";
	private static String[] productList = { "apple" };

	private static final String AGENT_NAME_OBS = "observer";

	/**
	 * @param args
	 * @throws CartagoException
	 */
	public static void main(String[] args) throws CartagoException {

		CartagoService.startNode();
		CartagoNode node = CartagoNode.getInstance();
		node.createWorkspace(PAZAR_ENV_NAME);

		CartagoBasicContext ctXObs = new CartagoBasicContext(AGENT_NAME_OBS,
				PAZAR_ENV_NAME);

		ArtifactId artifactIdStall1 = ctXObs.makeArtifact("Stall1Apple",
				"mypazar.cartago.DenemeStall", productList);

		Thread ctx1Thread = new DenemeCartagoCtx1(artifactIdStall1);

		ctx1Thread.start();

		Thread ctx2Thread = new DenemeCartagoCtx2(artifactIdStall1);

		ctx2Thread.start();
	}

}
